﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using WP8.ApplicationLifecycle.Resources;

namespace WP8.ApplicationLifecycle
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            this.State["Nombre"] = this.txtNombre.Text;
            this.State["Correo"] = this.txtCorreo.Text;
            this.State["Mensaje"] = this.txtMensaje.Text;

            base.OnNavigatedFrom(e);
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            //this.txtNombre.Text = this.State["Nombre"].ToString();
            //this.txtCorreo.Text = this.State["Correo"].ToString();
            //this.txtMensaje.Text = this.State["Mensaje"].ToString();

            base.OnNavigatedTo(e);
        }
        #region Events
        private void btnEnviar_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new Uri("/ConfirmPage.xaml", UriKind.Relative));
        }
        #endregion

    }
}